<?php
session_start();

if($_SERVER["REQUEST_METHOD"] == "POST") {
    $Nama = trim(mysql_real_escape_string($_POST["txtNama"]));
    $NoHp = trim(mysql_real_escape_string($_POST["txtNoHp"]));
    $Email = trim(mysql_real_escape_string($_POST["txtEmail"]));
    $Hal = trim(mysql_real_escape_string($_POST["txtHal"]));
    $Detail = trim(mysql_real_escape_string($_POST["txtDetail"]));
    
    $to = "novan.ananda@gmail.com";
    $subject = $Hal;
    $headers = "From:" . $Email;
    $message = $Detail.' ('.$Nama.', '.$NoHp.', '.$Email.')';
    mail($to,$subject,$message,$headers);
    header("location: ../mailForm.php");
}
?>
